<template>
  <div>
    <base-echart :options="options"></base-echart>
  </div>
</template>

<script lang="ts">
import { defineComponent, computed, PropType } from 'vue'
import BaseEchart from '../../../base-ui/echart/index'
import { IDataType } from '../types/index'
export default defineComponent({
  props: {
    roseData: Array as PropType<IDataType[]>
  },
  components: {
    BaseEchart
  },
  setup(props) {
    const options = computed(() => {
      return {
        // legend: {
        //   top: 'bottom'
        // },
        toolbox: {
          show: true,
          feature: {
            mark: { show: true },
            dataView: { show: true, readOnly: false },
            restore: { show: true },
            saveAsImage: { show: true }
          }
        },
        series: [
          {
            name: '类别数据',
            type: 'pie',
            radius: [10, 100],
            center: ['50%', '50%'],
            roseType: 'area',
            itemStyle: {
              borderRadius: 8
            },
            data: props.roseData
          }
        ]
      }
    })

    return {
      options
    }
  }
})
</script>

<style scoped></style>
